package com.example.eschool.fragment;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.eschool.CardBalanceActivity;
import com.example.eschool.CardJieGuaActivity;
import com.example.eschool.CardLostActivity;
import com.example.eschool.CardTopUpActivity;
import com.example.eschool.NewsActivity;
import com.example.eschool.PayCodeActivity;
import com.example.eschool.R;
import com.example.eschool.SchoolActivity;
import com.example.eschool.TradeActivity;
import com.example.eschool.bean.PayCode;

public class HomeFragment extends Fragment {

    public HomeFragment() {

    }
    private TextView pay_code;
    private TextView pay_code2;
    private TextView card_top_up;
    private TextView card_balance;

    private TextView school;
    private TextView news;
    private TextView card_top_up2;
    private TextView trade;
    private TextView card_lost;
    private TextView card_jiegua;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_home, container, false);

        pay_code = view.findViewById(R.id.pay_code);
        pay_code2 = view.findViewById(R.id.pay_code2);
        card_top_up = view.findViewById(R.id.card_top_up);
        card_balance = view.findViewById(R.id.card_balance);
        school = view.findViewById(R.id.school);
        news = view.findViewById(R.id.news);
        card_top_up2 = view.findViewById(R.id.card_top_up2);
        trade = view.findViewById(R.id.trade);
        card_lost = view.findViewById(R.id.card_lost);
        card_jiegua = view.findViewById(R.id.card_jiegua);

//        付款码
        pay_code.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                Intent payCodeIntent = new Intent(view.getContext(), PayCodeActivity.class);
                startActivity(payCodeIntent);
            }
        });
        //        付款码2
        pay_code2.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                Intent payCodeIntent2 = new Intent(view.getContext(), PayCodeActivity.class);
                startActivity(payCodeIntent2);
            }
        });
//        卡充值
        card_top_up.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent topUpIntent = new Intent(view.getContext(), CardTopUpActivity.class);
                startActivity(topUpIntent);
            }
        });

        //        卡充值
        card_top_up2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent topUpIntent2 = new Intent(view.getContext(), CardTopUpActivity.class);
                startActivity(topUpIntent2);
            }
        });
//卡余额
        card_balance.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent balanceIntent = new Intent(view.getContext(), CardBalanceActivity.class);
                startActivity(balanceIntent);
            }
        });

        //学校
        school.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent schoolIntent = new Intent(view.getContext(), SchoolActivity.class);
                startActivity(schoolIntent);
            }
        });

        //新闻公告
        news.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent newsIntent = new Intent(view.getContext(), NewsActivity.class);
                startActivity(newsIntent);
            }
        });

        //        付款码
        trade.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v) {
                Intent tradeIntent = new Intent(view.getContext(), TradeActivity.class);
                startActivity(tradeIntent);
            }
        });

        //        付款码
        card_lost.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v) {
                Intent lostIntent = new Intent(view.getContext(), CardLostActivity.class);
                startActivity(lostIntent);
            }
        });

        card_jiegua.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v) {
                Intent jieguaIntent = new Intent(view.getContext(), CardJieGuaActivity.class);
                startActivity(jieguaIntent);
            }
        });
        return view;
//        return inflater.inflate(R.layout.fragment_home, container, false);
    }
}